package com.yingli.pattern.mvvm;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.yingli.pattern.R;
import com.yingli.pattern.databinding.ActivityMvvmBinding;

public class MVVMActivity extends AppCompatActivity {

    private ActivityMvvmBinding binding;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.activity_mvvm);
//        binding.setValue("mvvm测试值");
        Person person = new Person();
        person.setName("xiaoqin");
        person.setNickname("hailizi");
        person.setWechat("123");
        binding.setPerson(person);
        person.setNickname("lily");
    }
}
